<template>
  <a-drawer
    title="评阅信息"
    wrapClassName="fullscreen"
    height="100%"
    placement="bottom"
    :closable="false"
    @close="handleCancel"
    :visible="editVisible" >
    <a-card class="card" :bordered="false">
        <div class="table-page-search-wrapper">
          <a-form layout="inline">
            <a-row :gutter="48">
               <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}">
                <a-form-item label="学号">
                  <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="queryParam.zsnj">
                    <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
               <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}">
                <a-form-item label="姓名">
                  <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="queryParam.zsnj">
                    <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}">
                <a-form-item label="学生类别">
                  <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="queryParam.zsnj">
                    <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}">
                <a-form-item label="院系">
                  <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="queryParam.zsnj">
                    <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}" >
                <a-form-item label="专业">
                  <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="queryParam.bkyxsm" @change="yxChange">
                    <a-select-option v-for="i in selectMenu.yx" :key="i.id" :value="i.dwh">{{ i.dwh+'-'+i.dwmc }}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}">
                <a-form-item label="年级">
                  <a-input placeholder="请输入..." v-model="queryParam.ksxm"/>
                </a-form-item>
              </a-col>
              <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:6}">
                <a-form-item label="论文题目">
                  <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="queryParam.bkzydm">
                    <a-select-option v-for="i in selectMenu.zy" :key="i.zyh" :value="i.zyh">{{ i.zyh+'-'+i.zymc }}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :sm="{span:24}" :xl="{span:12}" style="text-align:center">
                <a-button type="primary" @click="handleAdd" >新增</a-button>
                <a-button type="primary" >修改</a-button>
                <a-button type="primary" >删除</a-button>
              </a-col>
            </a-row>
          </a-form>
        </div>
        </a-card>
        <a-card class="card" :bordered="false">
        <a-table
          ref="table"
          size="default"
          rowKey="key"
          :columns="columns"
          :loading="loading"
          :dataSource="data"
          :pagination="false"
        >
          <span slot="serial" slot-scope="text, record, index">
            {{ index + 1 }}
          </span>
        </a-table>
        </a-card>
    <div class="drawer-bootom-button" style="z-index:1">
        <div style="float:right">
            <a-button type="primary" @click="handleCancel">关闭窗口</a-button>
        </div>
    </div>
    <manageEdit ref="manageEdit" :editVisible="manageEditVisible" @close="handleEditClose" />
  </a-drawer>
</template>

<script>
import { STable } from '~'
import manageEdit from './manageEdit.vue'

export default {
  props: {
    editVisible: {
      default: false
    }
  },
  components: {
    STable,
    manageEdit
  },
  data () {
    return {
      manageEditVisible:false,
      loading: false,
      queryParam: {},
      data:[],
      imageUrl: '',
      selectMenu: {
        yx: [] // 院系
      },
      TYPE0126:[],
      columns: [
        {
          title: '序号',
          scopedSlots: { customRender: 'serial' }
        },
        {
          title: '是否匿名',
          dataIndex: 'zsnj'
        },
        {
          title: '评阅人',
          dataIndex: 'zsnj2'
        },
        {
          title: '职称',
          dataIndex: 'zsnj3'
        },
        {
          title: '单位',
          dataIndex: 'ksxm'
        },
        {
          title: '是否硕导',
          dataIndex: 'bkyxsmc'
        },
        {
          title: '是否博导',
          dataIndex: 'bkzydm'
        },
        {
          title: '是否达到学位水平',
          dataIndex: 'bkzymc'
        },
        {
          title: '是否同意答辩',
          dataIndex: 'bkyjfxmc'
        },
        {
          title: '评阅成绩',
          dataIndex: 'bkdsyxm'
        }
      ],
      options: {
        alert: { show: false },
        rowSelection: {
          onChange: (selectedRowKeys, selectedRows) => {
            console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
          },
          onSelect: (record, selected, selectedRows) => {
            console.log(record, selected, selectedRows)
          },
          onSelectAll: (selected, selectedRows, changeRows) => {
            console.log(selected, selectedRows, changeRows)
          }
        }
      },
      // 当前所在信息节点
      infoIdx: 0,
      baseInfo:{}
    }
  },
  created () {
  },
  methods: {
    // 关闭
    handleCancel () {
      this.$emit('close')
    },
    //新增
    handleAdd(){
      this.manageEditVisible = true;
    },
    // 关闭添加弹层
    handleEditClose() {
      this.manageEditVisible = false
    },
    // 保存修改
    handleSave () {

    },
    yxChange(){}
  }
}
</script>

<style lang="less">
.fullscreen{
    .ant-drawer-wrapper-body{
        height: 100%;
        overflow: auto;
    }
}
</style>
